package cn.fourhundredandeighteen.view.Component;

import cn.fourhundredandeighteen.view.loginView.LoginView;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Setting extends JPanel {
    private Button logOut;

    public Setting() {
        initComponents();
        this.setVisible(true);
    }

    public void initComponents() {
        logOut = new Button("退出登录", Button.CANCELBUTTON);
        logOut.addActionListener(new Listener());

        this.setLayout(new FlowLayout(0, 25, 25));
        this.add(logOut);
    }

    class Listener implements ActionListener {
        @Override
        public void actionPerformed(ActionEvent e) {
            Container.close();
            new LoginView();
        }
    }

}
